Skip to content

Prevent panic on fuzzer provided string#14405

Merged
lunny merged 5 commits into
go-gitea:masterfrom
zeripath:alternate-fuzz-fix
Jan 20, 2021
Merged

Prevent panic on fuzzer provided string#14405
lunny merged 5 commits into
go-gitea:masterfrom
zeripath:alternate-fuzz-fix

Conversation

@zeripath
Copy link
Copy Markdown
Contributor

The fuzzer has found that providing a tag with an attribute to
PostProcess causes a panic. This PR removes any rendered html or body
tags from the output.

Replaces #14402

Signed-off-by: Andrew Thornton art27@cantab.net

The fuzzer has found that providing a <body> tag with an attribute to
PostProcess causes a panic. This PR removes any rendered html or body
tags from the output.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Comment thread modules/markup/html.go Outdated
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 20, 2021
Comment thread modules/markup/html.go Outdated
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Copy Markdown
Contributor Author

@lunny - the body wraparound is necessary.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 20, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 20, 2021
@lunny lunny merged commit 1722299 into go-gitea:master Jan 20, 2021
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Jan 20, 2021
* Prevent panic on fuzzer provided string

The fuzzer has found that providing a <body> tag with an attribute to
PostProcess causes a panic. This PR removes any rendered html or body
tags from the output.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Placate lint

* placate lint again

Signed-off-by: Andrew Thornton <art27@cantab.net>

* minor cleanup

Signed-off-by: Andrew Thornton <art27@cantab.net>
@6543
Copy link
Copy Markdown
Member

6543 commented Jan 20, 2021

Backport: #14409

@6543 6543 added the backport/done All backports for this PR have been created label Jan 20, 2021
@zeripath zeripath deleted the alternate-fuzz-fix branch January 20, 2021 16:28
lafriks pushed a commit that referenced this pull request Jan 20, 2021
* Prevent panic on fuzzer provided string

The fuzzer has found that providing a <body> tag with an attribute to
PostProcess causes a panic. This PR removes any rendered html or body
tags from the output.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Placate lint

* placate lint again

Signed-off-by: Andrew Thornton <art27@cantab.net>

* minor cleanup

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
@6543 6543 added the topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! label Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants